import request from '@/utils/request'

// 查询店铺商品关联列表
export function listShop(query) {
  return request({
    url: '/goods/shop/list',
    method: 'get',
    params: query
  })
}

// 不分页
export function listAll(query) {
  return request({
    url: '/goods/shop/listAll',
    method: 'get',
    params: query
  })
}

// 查询店铺商品关联详细
export function getShop(gshopId) {
  return request({
    url: '/goods/shop/' + gshopId,
    method: 'get'
  })
}

// 新增店铺商品关联
export function addShop(data) {
  return request({
    url: '/goods/shop',
    method: 'post',
    data: data
  })
}

// 修改店铺商品关联
export function updateShop(data) {
  return request({
    url: '/goods/shop',
    method: 'put',
    data: data
  })
}

// 删除店铺商品关联
export function delShop(gshopId) {
  return request({
    url: '/goods/shop/' + gshopId,
    method: 'delete'
  })
}

// 查询店铺下拉树结构
export function shopTreeSelect() {
  return request({
    url: '/goods/shop/shopTree',
    method: 'get'
  })
}

// 查询商品最大顺序值
export function findMaxOrderNum(deptId) {
  return request({
    url: '/goods/shop/findMaxOrderNum/' + deptId,
    method: 'get'
  })
}

export function shopOptions() {
  return request({
    url: '/goods/shop/shopOptions',
    method: 'get'
  })
}

export function getgoodsTypeNumEcharts() {
  return request({
    url: '/goods/shop/goodsTypeNumEcharts',
    method: 'get'
  })
}

export function putOnShops(data) {
  return request({
    url: '/goods/shop/putOnShops',
    method: 'post',
    data: data
  })
}

export function putOutShops(data) {
  return request({
    url: '/goods/shop/putOutShops',
    method: 'post',
    data: data
  })
}

export function getGoodsMain(data) {
  return request({
    url: '/goods/shop/getGoodsMain' + '/' + data.deptId + '/' + data.gNumber,
    method: 'get',
  })
}
